<!DOCTYPE html>
<html lang="en" dir="ltr" class="client-nojs">
<head>
<title>std::formatter - cppreference.com</title>
<meta charset="UTF-8">
<meta name="generator" content="MediaWiki 1.21.2">
<link rel="shortcut icon" href="../../../../common/favicon.ico">
<link rel="stylesheet" href="../../../../common/ext.css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" href="../../../../common/site_modules.css">
<style>a:lang(ar),a:lang(ckb),a:lang(fa),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}#toc{display:none}.editsection{display:none}
/* cache key: mwiki1-mwiki_en_:resourceloader:filter:minify-css:7:472787eddcf4605d11de8c7ef047234f */</style>

<script src="../../../../common/startup_scripts.js"></script>
<script>if(window.mw){
mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"cpp/utility/format/formatter","wgTitle":"cpp/utility/format/formatter","wgCurRevisionId":141498,"wgArticleId":18708,"wgIsArticle":true,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"cpp/utility/format/formatter","wgRestrictionEdit":[],"wgRestrictionMove":[]});
}</script><script>if(window.mw){
mw.loader.implement("user.options",function(){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"disablesuggest":0,"editfont":"default","editondblclick":0,"editsection":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":0,"extendwatchlist":0,"externaldiff":0,"externaleditor":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"justify":0,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nocache":0,"noconvertlink":0,"norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"quickbar":5,"rcdays":7,"rclimit":50,"rememberpassword":0,"rows":25,"searchlimit":20,"showhiddencats":0,"showjumplinks":1,"shownumberswatching":1,"showtoc":0,"showtoolbar":1,"skin":"cppreference2","stubthreshold":0,"thumbsize":2,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":0,"watchdefault":0,"watchdeletion":0,
"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"wllimit":250,"variant":"en","language":"en","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"gadget-ColiruCompiler":1,"gadget-MathJax":1});;},{},{});mw.loader.implement("user.tokens",function(){mw.user.tokens.set({"editToken":"+\\","patrolToken":false,"watchToken":false});;},{},{});
/* cache key: mwiki1-mwiki_en_:resourceloader:filter:minify-js:7:9f05c6caceb9bb1a482b6cebd4c5a330 */
}</script>
<script>if(window.mw){
mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax"]);
}</script>
<style type="text/css">/*<![CDATA[*/
.source-cpp {line-height: normal;}
.source-cpp li, .source-cpp pre {
	line-height: normal; border: 0px none white;
}
/**
 * GeSHi Dynamically Generated Stylesheet
 * --------------------------------------
 * Dynamically generated stylesheet for cpp
 * CSS class: source-cpp, CSS id: 
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 * --------------------------------------
 */
.cpp.source-cpp .de1, .cpp.source-cpp .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
.cpp.source-cpp  {font-family:monospace;}
.cpp.source-cpp .imp {font-weight: bold; color: red;}
.cpp.source-cpp li, .cpp.source-cpp .li1 {font-weight: normal; vertical-align:top;}
.cpp.source-cpp .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
.cpp.source-cpp .li2 {font-weight: bold; vertical-align:top;}
.cpp.source-cpp .kw1 {color: #0000dd;}
.cpp.source-cpp .kw2 {color: #0000ff;}
.cpp.source-cpp .kw3 {color: #0000dd;}
.cpp.source-cpp .kw4 {color: #0000ff;}
.cpp.source-cpp .co1 {color: #909090;}
.cpp.source-cpp .co2 {color: #339900;}
.cpp.source-cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp.source-cpp .es0 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es1 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es2 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es3 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es4 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es5 {color: #008000; font-weight: bold;}
.cpp.source-cpp .br0 {color: #008000;}
.cpp.source-cpp .sy0 {color: #008000;}
.cpp.source-cpp .sy1 {color: #000080;}
.cpp.source-cpp .sy2 {color: #000040;}
.cpp.source-cpp .sy3 {color: #000040;}
.cpp.source-cpp .sy4 {color: #008080;}
.cpp.source-cpp .st0 {color: #008000;}
.cpp.source-cpp .nu0 {color: #000080;}
.cpp.source-cpp .nu6 {color: #000080;}
.cpp.source-cpp .nu8 {color: #000080;}
.cpp.source-cpp .nu12 {color: #000080;}
.cpp.source-cpp .nu16 {color:#000080;}
.cpp.source-cpp .nu17 {color:#000080;}
.cpp.source-cpp .nu18 {color:#000080;}
.cpp.source-cpp .nu19 {color:#000080;}
.cpp.source-cpp .ln-xtra, .cpp.source-cpp li.ln-xtra, .cpp.source-cpp div.ln-xtra {background-color: #ffc;}
.cpp.source-cpp span.xtra { display:block; }

/*]]>*/
</style><style type="text/css">/*<![CDATA[*/
.source-text {line-height: normal;}
.source-text li, .source-text pre {
	line-height: normal; border: 0px none white;
}
/**
 * GeSHi Dynamically Generated Stylesheet
 * --------------------------------------
 * Dynamically generated stylesheet for text
 * CSS class: source-text, CSS id: 
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 * --------------------------------------
 */
.text.source-text .de1, .text.source-text .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
.text.source-text  {font-family:monospace;}
.text.source-text .imp {font-weight: bold; color: red;}
.text.source-text li, .text.source-text .li1 {font-weight: normal; vertical-align:top;}
.text.source-text .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
.text.source-text .li2 {font-weight: bold; vertical-align:top;}
.text.source-text .ln-xtra, .text.source-text li.ln-xtra, .text.source-text div.ln-xtra {background-color: #ffc;}
.text.source-text span.xtra { display:block; }

/*]]>*/
</style><!--[if lt IE 7]><style type="text/css">body{behavior:url("/mwiki/skins/cppreference2/csshover.min.htc")}</style><![endif]--></head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-cpp_utility_format_formatter skin-cppreference2 action-view cpp-navbar">
        <!-- header -->
        <!-- /header -->
        <!-- content -->
<div id="cpp-content-base">
            <div id="content">
                <a id="top"></a>
                <div id="mw-js-message" style="display:none;"></div>
                                <!-- firstHeading -->
<h1 id="firstHeading" class="firstHeading"><span style="font-size:0.7em; line-height:130%">std::</span>formatter</h1>
                <!-- /firstHeading -->
                <!-- bodyContent -->
                <div id="bodyContent">
                                        <!-- tagline -->
                    <div id="siteSub">From cppreference.com</div>
                    <!-- /tagline -->
                                        <!-- subtitle -->
                    <div id="contentSub"><span class="subpages">&lt; <a href="../../../cpp.html" title="cpp">cpp</a>‎ | <a href="../../utility.html" title="cpp/utility">utility</a>‎ | <a href="../format.html" title="cpp/utility/format">format</a></span></div>
                    <!-- /subtitle -->
                                                            <!-- bodycontent -->
                    <div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div class="t-navbar" style=""><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../../../cpp.html" title="cpp"> C++</a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em;">
<tr class="t-nv"><td colspan="5"> <a href="../../compiler_support.html" title="cpp/compiler support"> Compiler support</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../freestanding.html" title="cpp/freestanding"> Freestanding and hosted</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../language.html" title="cpp/language"> Language</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../header.html" title="cpp/header"> Standard library headers</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../named_req.html" title="cpp/named req"> Named requirements </a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../feature_test.html" title="cpp/feature test"> Feature test macros </a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../utility.html#Language_support" title="cpp/utility"> Language support library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../concepts.html" title="cpp/concepts"> Concepts library</a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../meta.html" title="cpp/meta"> Metaprogramming library</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../error.html" title="cpp/error"> Diagnostics library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../utility.html" title="cpp/utility"> General utilities library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../string.html" title="cpp/string"> Strings library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../container.html" title="cpp/container"> Containers library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../iterator.html" title="cpp/iterator"> Iterators library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../ranges.html" title="cpp/ranges"> Ranges library</a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../algorithm.html" title="cpp/algorithm"> Algorithms library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../numeric.html" title="cpp/numeric"> Numerics library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../locale.html" title="cpp/locale"> Localizations library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../io.html" title="cpp/io"> Input/output library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../filesystem.html" title="cpp/filesystem"> Filesystem library</a> <span class="t-mark-rev t-since-cxx17">(C++17)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../regex.html" title="cpp/regex"> Regular expressions library</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../thread.html" title="cpp/thread"> Concurrency support library</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../experimental.html" title="cpp/experimental"> Technical specifications</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../symbol_index.html" title="cpp/symbol index"> Symbols index</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../links/libs.html" title="cpp/links/libs"> External libraries</a> </td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../../utility.html" title="cpp/utility"> Utilities library</a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv-h1"><td colspan="5"> Language support</td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../types.html" title="cpp/types"> Type support</a> (basic types, RTTI)</td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../feature_test.html" title="cpp/utility/feature test"> Library feature-test macros </a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../memory.html" title="cpp/memory"> Dynamic memory management</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../program.html" title="cpp/utility/program"> Program utilities</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../coroutine.html" title="cpp/coroutine"> Coroutine support</a> <span class="t-mark-rev t-since-cxx20">(C++20)</span></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../variadic.html" title="cpp/utility/variadic"> Variadic functions</a> </td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../../types/is_constant_evaluated.html" title="cpp/types/is constant evaluated"><span class="t-lines"><span>is_constant_evaluated</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../launder.html" title="cpp/utility/launder"><span class="t-lines"><span>launder</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../initializer_list.html" title="cpp/utility/initializer list"><span class="t-lines"><span>initializer_list</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../source_location.html" title="cpp/utility/source location"><span class="t-lines"><span>source_location</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> Three-way comparison <span class="t-mark-rev t-since-cxx20">(C++20)</span></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../compare/three_way_comparable.html" title="cpp/utility/compare/three way comparable"><span class="t-lines"><span>three_way_comparable</span><span>three_way_comparable_with</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../compare/strong_ordering.html" title="cpp/utility/compare/strong ordering"><span class="t-lines"><span>strong_ordering</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../compare/weak_ordering.html" title="cpp/utility/compare/weak ordering"><span class="t-lines"><span>weak_ordering</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../compare/partial_ordering.html" title="cpp/utility/compare/partial ordering"><span class="t-lines"><span>partial_ordering</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../compare/common_comparison_category.html" title="cpp/utility/compare/common comparison category"><span class="t-lines"><span>common_comparison_category</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../compare/compare_three_way_result.html" title="cpp/utility/compare/compare three way result"><span class="t-lines"><span>compare_three_way_result</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../compare/compare_three_way.html" title="cpp/utility/compare/compare three way"><span class="t-lines"><span>compare_three_way</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../compare/strong_order.html" title="cpp/utility/compare/strong order"><span class="t-lines"><span>strong_order</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../compare/weak_order.html" title="cpp/utility/compare/weak order"><span class="t-lines"><span>weak_order</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../compare/partial_order.html" title="cpp/utility/compare/partial order"><span class="t-lines"><span>partial_order</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../compare/compare_strong_order_fallback.html" title="cpp/utility/compare/compare strong order fallback"><span class="t-lines"><span>compare_strong_order_fallback</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../compare/compare_weak_order_fallback.html" title="cpp/utility/compare/compare weak order fallback"><span class="t-lines"><span>compare_weak_order_fallback</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../compare/compare_partial_order_fallback.html" title="cpp/utility/compare/compare partial order fallback"><span class="t-lines"><span>compare_partial_order_fallback</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span>   </span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../compare/named_comparison_functions.html" title="cpp/utility/compare/named comparison functions"><span class="t-lines"><span>is_eq</span><span>is_neq</span><span>is_lt</span><span>is_lteq</span><span>is_gt</span><span>is_gteq</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv-h1"><td colspan="5"> General utilities</td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../chrono.html" title="cpp/chrono"> Date and time</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../functional.html" title="cpp/utility/functional"> Function objects</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../format.html" title="cpp/utility/format"> Formatting library</a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../bitset.html" title="cpp/utility/bitset"><span class="t-lines"><span>bitset</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../hash.html" title="cpp/utility/hash"><span class="t-lines"><span>hash</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> Relational operators <span class="t-mark-rev t-deprecated-cxx20">(deprecated in C++20)</span> </td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../rel_ops/operator_cmp.html" title="cpp/utility/rel ops/operator cmp"><span class="t-lines"><span>rel_ops::operator!=</span><span>rel_ops::operator&gt;</span></span></a></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../rel_ops/operator_cmp.html" title="cpp/utility/rel ops/operator cmp"><span class="t-lines"><span>rel_ops::operator&lt;=</span><span>rel_ops::operator&gt;=</span></span></a></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> Integer comparison functions</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../intcmp.html" title="cpp/utility/intcmp"><span class="t-lines"><span>cmp_equal</span><span>cmp_less</span><span>cmp_less_than</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span>   </span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../intcmp.html" title="cpp/utility/intcmp"><span class="t-lines"><span>cmp_not_equal</span><span>cmp_greater</span><span>cmp_greater_than</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../in_range.html" title="cpp/utility/in range"><span class="t-lines"><span>in_range</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> Swap and type operations</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../../algorithm/swap.html" title="cpp/algorithm/swap"><span class="t-lines"><span>swap</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../ranges/swap.html" title="cpp/utility/ranges/swap"><span class="t-lines"><span>ranges::swap</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../exchange.html" title="cpp/utility/exchange"><span class="t-lines"><span>exchange</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx14">(C++14)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../declval.html" title="cpp/utility/declval"><span class="t-lines"><span>declval</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../to_underlying.html" title="cpp/utility/to underlying"><span class="t-lines"><span>to_underlying</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx23">(C++23)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../forward.html" title="cpp/utility/forward"><span class="t-lines"><span>forward</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../forward_like.html" title="cpp/utility/forward like"><span class="t-lines"><span>forward_like</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx23">(C++23)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../move.html" title="cpp/utility/move"><span class="t-lines"><span>move</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../move_if_noexcept.html" title="cpp/utility/move if noexcept"><span class="t-lines"><span>move_if_noexcept</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../as_const.html" title="cpp/utility/as const"><span class="t-lines"><span>as_const</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> Common vocabulary types </td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../pair.html" title="cpp/utility/pair"><span class="t-lines"><span>pair</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../tuple.html" title="cpp/utility/tuple"><span class="t-lines"><span>tuple</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../optional.html" title="cpp/utility/optional"><span class="t-lines"><span>optional</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../any.html" title="cpp/utility/any"><span class="t-lines"><span>any</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../variant.html" title="cpp/utility/variant"><span class="t-lines"><span>variant</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../tuple_size.html" title="cpp/utility/tuple size"><span class="t-lines"><span>tuple_size</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../tuple_element.html" title="cpp/utility/tuple element"><span class="t-lines"><span>tuple_element</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../apply.html" title="cpp/utility/apply"><span class="t-lines"><span>apply</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../make_from_tuple.html" title="cpp/utility/make from tuple"><span class="t-lines"><span>make_from_tuple</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="https://en.cppreference.com/mwiki/index.php?title=cpp/utility/expected&amp;action=edit&amp;redlink=1" class="new" title="cpp/utility/expected (page does not exist)"><span class="t-lines"><span>expected</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx23">(C++23)</span></span></span></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> Elementary string conversions</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../to_chars.html" title="cpp/utility/to chars"><span class="t-lines"><span>to_chars</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../from_chars.html" title="cpp/utility/from chars"><span class="t-lines"><span>from_chars</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../chars_format.html" title="cpp/utility/chars format"><span class="t-lines"><span>chars_format</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div></div></td></tr>
</table></div></td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../format.html" title="cpp/utility/format"> Formatting library</a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv-h1"><td colspan="5"> Formatting functions</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="format.html" title="cpp/utility/format/format"><span class="t-lines"><span>format</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="format_to.html" title="cpp/utility/format/format to"><span class="t-lines"><span>format_to</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="format_to_n.html" title="cpp/utility/format/format to n"><span class="t-lines"><span>format_to_n</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="formatted_size.html" title="cpp/utility/format/formatted size"><span class="t-lines"><span>formatted_size</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="vformat.html" title="cpp/utility/format/vformat"><span class="t-lines"><span>vformat</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="vformat_to.html" title="cpp/utility/format/vformat to"><span class="t-lines"><span>vformat_to</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> Formatter</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><strong class="selflink"><span class="t-lines"><span>formatter</span></span></strong></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="basic_format_parse_context.html" title="cpp/utility/format/basic format parse context"><span class="t-lines"><span>basic_format_parse_context</span><span>format_parse_context</span><span>wformat_parse_context</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="basic_format_context.html" title="cpp/utility/format/basic format context"><span class="t-lines"><span>basic_format_context</span><span>format_context</span><span>wformat_context</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> Formatting arguments</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="basic_format_arg.html" title="cpp/utility/format/basic format arg"><span class="t-lines"><span>basic_format_arg</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="basic_format_args.html" title="cpp/utility/format/basic format args"><span class="t-lines"><span>basic_format_args</span><span>format_args</span><span>wformat_args</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="visit_format_arg.html" title="cpp/utility/format/visit format arg"><span class="t-lines"><span>visit_format_arg</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="make_format_args.html" title="cpp/utility/format/make format args"><span class="t-lines"><span>make_format_args</span><span>make_wformat_args</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv-h1"><td colspan="5"> Format error</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="format_error.html" title="cpp/utility/format/format error"><span class="t-lines"><span>format_error</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div></div>
<table class="t-dcl-begin"><tbody>
<tr class="t-dsc-header">
<td> <div>Defined in header <code><a href="../../header/format.html" title="cpp/header/format">&lt;format&gt;</a></code>
 </div></td>
<td></td>
<td></td>
</tr>
<tr class="t-dcl t-since-cxx20">
<td> <div><span class="mw-geshi cpp source-cpp"><span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T, <span class="kw1">class</span> CharT <span class="sy1">=</span> <span class="kw4">char</span><span class="sy1">&gt;</span><br>
<span class="kw1">struct</span> formatter<span class="sy4">;</span></span></div></td>
<td class="t-dcl-nopad">  </td>
<td> <span class="t-mark-rev t-since-cxx20">(since C++20)</span> </td>
</tr>
<tr class="t-dcl-sep"><td></td><td></td><td></td></tr>
</tbody></table>
<p>The enabled specializations of <code>formatter</code> define formatting rules for a given type. Enabled specializations meet the <a href="../../named_req/Formatter.html" title="cpp/named req/Formatter"><span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">Formatter</span></a> requirements. In particular, they define callables <code>parse</code> and <code>format</code>.
</p><p>For all types <code>T</code> and <code>CharT</code> for which no specialization <code>std::formatter&lt;T, CharT&gt;</code> is enabled, that specialization is a complete type and is disabled.
</p><p>Disabled specializations do not meet the <a href="../../named_req/Formatter.html" title="cpp/named req/Formatter"><span style="font-family: Georgia, 'DejaVu Serif', serif; font-style:italic">Formatter</span></a> requirements, and the following are all <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw2">false</span></span></span>:
</p>
<ul><li> <span class="t-lc"><a href="../../types/is_default_constructible.html" title="cpp/types/is default constructible">std::is_default_constructible_v</a></span>
</li><li> <span class="t-lc"><a href="../../types/is_copy_constructible.html" title="cpp/types/is copy constructible">std::is_copy_constructible_v</a></span>
</li><li> <span class="t-lc"><a href="../../types/is_move_constructible.html" title="cpp/types/is move constructible">std::is_move_constructible_v</a></span>
</li><li> <span class="t-lc"><a href="../../types/is_copy_assignable.html" title="cpp/types/is copy assignable">std::is_copy_assignable_v</a></span>
</li><li> <span class="t-lc"><a href="../../types/is_move_assignable.html" title="cpp/types/is move assignable">std::is_move_assignable_v</a></span>.
</li></ul>
<h3><span class="mw-headline" id="Standard_specializations_for_basic_types_and_string_types">Standard specializations for basic types and string types</span></h3>
<p>In the following list, <code>CharT</code> is either <code>char</code> or <code>wchar_t</code>, <code>ArithmeticT</code> is any cv-unqualified arithmetic type other than <code>char</code>, <code>wchar_t</code>, <code>char8_t</code>, <code>char16_t</code>, or <code>char32_t</code>.
</p>
<table class="t-dcl-begin"><tbody>
<tr class="t-dcl">
<td class="t-dcl-nopad"> <div><span class="mw-geshi cpp source-cpp"><span class="kw1">template</span><span class="sy1">&lt;&gt;</span> <span class="kw1">struct</span> formatter<span class="sy1">&lt;</span><span class="kw4">char</span>, <span class="kw4">char</span><span class="sy1">&gt;</span><span class="sy4">;</span><br>
<p><span class="kw1">template</span><span class="sy1">&lt;&gt;</span> <span class="kw1">struct</span> formatter<span class="sy1">&lt;</span><span class="kw4">char</span>, <span class="kw4">wchar_t</span><span class="sy1">&gt;</span><span class="sy4">;</span><br>
<span class="kw1">template</span><span class="sy1">&lt;&gt;</span> <span class="kw1">struct</span> formatter<span class="sy1">&lt;</span><span class="kw4">wchar_t</span>, <span class="kw4">wchar_t</span><span class="sy1">&gt;</span><span class="sy4">;</span><br>
<br>
<span class="kw1">template</span><span class="sy1">&lt;&gt;</span> <span class="kw1">struct</span> formatter<span class="sy1">&lt;</span>CharT<span class="sy2">*</span>, CharT<span class="sy1">&gt;</span><span class="sy4">;</span><br>
<span class="kw1">template</span><span class="sy1">&lt;&gt;</span> <span class="kw1">struct</span> formatter<span class="sy1">&lt;</span><span class="kw4">const</span> CharT<span class="sy2">*</span>, CharT<span class="sy1">&gt;</span><span class="sy4">;</span><br>
<span class="kw1">template</span><span class="sy1">&lt;</span><a href="../../types/size_t.html"><span class="kw106">std::<span class="me2">size_t</span></span></a> N<span class="sy1">&gt;</span> <span class="kw1">struct</span> formatter<span class="sy1">&lt;</span>CharT<span class="br0">[</span>N<span class="br0">]</span>, CharT<span class="sy1">&gt;</span><span class="sy4">;</span><br>
<span class="kw1">template</span><span class="sy1">&lt;</span><a href="../../types/size_t.html"><span class="kw106">std::<span class="me2">size_t</span></span></a> N<span class="sy1">&gt;</span> <span class="kw1">struct</span> formatter<span class="sy1">&lt;</span><span class="kw4">const</span> CharT<span class="br0">[</span>N<span class="br0">]</span>, CharT<span class="sy1">&gt;</span><span class="sy4">;</span><br>
<span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> Traits, <span class="kw1">class</span> Alloc<span class="sy1">&gt;</span><br>
  <span class="kw1">struct</span> formatter<span class="sy1">&lt;</span><a href="../../string/basic_string.html"><span class="kw1231">std::<span class="me2">basic_string</span></span></a><span class="sy1">&lt;</span>CharT, Traits, Alloc<span class="sy1">&gt;</span>, CharT<span class="sy1">&gt;</span><span class="sy4">;</span><br>
<span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> Traits<span class="sy1">&gt;</span><br>
  <span class="kw1">struct</span> formatter<span class="sy1">&lt;</span><a href="../../string/basic_string_view.html"><span class="kw1249">std::<span class="me2">basic_string_view</span></span></a><span class="sy1">&lt;</span>CharT, Traits<span class="sy1">&gt;</span>, CharT<span class="sy1">&gt;</span><span class="sy4">;</span><br>
<br>
<span class="kw1">template</span><span class="sy1">&lt;&gt;</span> <span class="kw1">struct</span> formatter<span class="sy1">&lt;</span>ArithmeticT, CharT<span class="sy1">&gt;</span><span class="sy4">;</span><br>
<br>
<span class="kw1">template</span><span class="sy1">&lt;&gt;</span> <span class="kw1">struct</span> formatter<span class="sy1">&lt;</span><a href="../../types/nullptr_t.html"><span class="kw108">std::<span class="me2">nullptr_t</span></span></a>, CharT<span class="sy1">&gt;</span><span class="sy4">;</span><br>
<span class="kw1">template</span><span class="sy1">&lt;&gt;</span> <span class="kw1">struct</span> formatter<span class="sy1">&lt;</span><span class="kw4">void</span><span class="sy2">*</span>, CharT<span class="sy1">&gt;</span><span class="sy4">;</span><br>
</p>
<span class="kw1">template</span><span class="sy1">&lt;&gt;</span> <span class="kw1">struct</span> formatter<span class="sy1">&lt;</span><span class="kw4">const</span> <span class="kw4">void</span><span class="sy2">*</span>, CharT<span class="sy1">&gt;</span><span class="sy4">;</span></span></div></td>
<td class="t-dcl-nopad">  </td>
<td class="t-dcl-nopad">  </td>
</tr>
<tr class="t-dcl-sep"><td></td><td></td><td></td></tr>
</tbody></table>
<p>Formatters for other pointers and pointers to members are disabled.
</p><p>Specializations such as <code>std::formatter&lt;wchar_t, char&gt;</code> and <code>std::formatter&lt;const char*, wchar_t&gt;</code> that would require encoding conversions are disabled.
</p>
<h4><span class="mw-headline" id="Standard_format_specification">Standard format specification</span></h4>
<p>For basic types and string types, the format specification is based on the <a rel="nofollow" class="external text" href="https://docs.python.org/3/library/string.html#formatspec">format specification in Python</a>.
</p><p>The syntax of format specifications is:
</p>
<table class="t-sdsc-begin">

<tr>
<td colspan="10" class="t-sdsc-sep">
</td></tr>
<tr class="t-sdsc">
<td class="t-sdsc-nopad"> <span class="t-spar">fill-and-align</span><span class="t-mark">(optional)</span> <span class="t-spar">sign</span><span class="t-mark">(optional)</span> <code><b>#</b></code><span class="t-mark">(optional)</span> <code><b>0</b></code><span class="t-mark">(optional)</span> <span class="t-spar">width</span><span class="t-mark">(optional)</span> <span class="t-spar">precision</span><span class="t-mark">(optional)</span> <code><b>L</b></code><span class="t-mark">(optional)</span> <span class="t-spar">type</span><span class="t-mark">(optional)</span>
</td>
<td class="t-sdsc-nopad">
</td>
<td class="t-sdsc-nopad">
</td></tr>



<tr>
<td colspan="10" class="t-sdsc-sep">
</td></tr></table>
<p>The <span class="t-spar">sign</span>, <code><b>#</b></code> and <code><b>0</b></code> options are only valid when an integer or floating-point presentation type is used.
</p>
<h5><span class="mw-headline" id="fill_and_align">fill and align</span></h5>
<p><span class="t-spar">fill-and-align</span> is an optional <i>fill</i> character (which can be any character other than <code><b>{</b></code> or <code><b>}</b></code>), followed by one of the <i>align</i> options <code><b>&lt;</b></code>, <code><b>&gt;</b></code>, <code><b>^</b></code>. The meaning of <i>align</i> options is as follows:
</p>
<ul><li> <code><b>&lt;</b></code>: Forces the field to be aligned to the start of the available space. This is the default when a non-integer non-floating-point presentation type is used.
</li><li> <code><b>&gt;</b></code>: Forces the field to be aligned to the end of the available space. This is the default when an integer or floating-point presentation type is used.
</li><li> <code><b>^</b></code>: Forces the field to be centered within the available space by inserting ⌊<span class="texhtml" style="white-space: nowrap;"><span class="t-mfrac"><table><tr><td>n</td></tr><tr><td>2</td></tr></table></span></span>⌋ characters before and ⌈<span class="texhtml" style="white-space: nowrap;"><span class="t-mfrac"><table><tr><td>n</td></tr><tr><td>2</td></tr></table></span></span>⌉ characters after the value, where <span class="texhtml" style="white-space: nowrap;">n</span> is the total number of fill characters to insert.
</li></ul>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw4">char</span> c <span class="sy1">=</span> <span class="nu0">120</span><span class="sy4">;</span>
<span class="kw4">auto</span> s0 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:6}"</span>, <span class="nu0">42</span><span class="br0">)</span><span class="sy4">;</span>    <span class="co1">// value of s0 is "    42"</span>
<span class="kw4">auto</span> s1 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:6}"</span>, <span class="st0">'x'</span><span class="br0">)</span><span class="sy4">;</span>   <span class="co1">// value of s1 is "x     "</span>
<span class="kw4">auto</span> s2 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:*&lt;6}"</span>, <span class="st0">'x'</span><span class="br0">)</span><span class="sy4">;</span> <span class="co1">// value of s2 is "x*****"</span>
<span class="kw4">auto</span> s3 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:*&gt;6}"</span>, <span class="st0">'x'</span><span class="br0">)</span><span class="sy4">;</span> <span class="co1">// value of s3 is "*****x"</span>
<span class="kw4">auto</span> s4 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:*^6}"</span>, <span class="st0">'x'</span><span class="br0">)</span><span class="sy4">;</span> <span class="co1">// value of s4 is "**x***"</span>
<span class="kw4">auto</span> s5 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:6d}"</span>, c<span class="br0">)</span><span class="sy4">;</span>    <span class="co1">// value of s5 is "   120"</span>
<span class="kw4">auto</span> s6 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:6}"</span>, <span class="kw2">true</span><span class="br0">)</span><span class="sy4">;</span>  <span class="co1">// value of s6 is "true  "</span></pre></div></div>
<h5><span class="mw-headline" id="sign.2C_.23.2C_and_0">sign, #, and 0</span></h5>
<p>The <span class="t-spar">sign</span> option can be one of following:
</p>
<ul><li> <code><b>+</b></code>: Indicates that a sign should be used for both non-negative and negative numbers. The <code>+</code> sign is inserted before the output value for non-negative numbers.
</li><li> <code><b>-</b></code>: Indicates that a sign should be used for negative numbers only (this is the default behavior).
</li><li> space: Indicates that a leading space should be used for non-negative numbers, and a minus sign for negative numbers.
</li></ul>
<p>Negative zero is treated as a negative number.
</p><p>The <span class="t-spar">sign</span> option applies to floating-point infinity and NaN.
</p>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw4">double</span> inf <span class="sy1">=</span> <a href="../../types/numeric_limits.html"><span class="kw350">std::<span class="me2">numeric_limits</span></span></a><span class="sy1">&lt;</span><span class="kw4">double</span><span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">infinity</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
<span class="kw4">double</span> nan <span class="sy1">=</span> <a href="../../types/numeric_limits.html"><span class="kw350">std::<span class="me2">numeric_limits</span></span></a><span class="sy1">&lt;</span><span class="kw4">double</span><span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">quiet_NaN</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
<span class="kw4">auto</span> s0 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{0:},{0:+},{0:-},{0: }"</span>, <span class="nu0">1</span><span class="br0">)</span><span class="sy4">;</span>   <span class="co1">// value of s0 is "1,+1,1, 1"</span>
<span class="kw4">auto</span> s1 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{0:},{0:+},{0:-},{0: }"</span>, <span class="sy2">-</span><span class="nu0">1</span><span class="br0">)</span><span class="sy4">;</span>  <span class="co1">// value of s1 is "-1,-1,-1,-1"</span>
<span class="kw4">auto</span> s2 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{0:},{0:+},{0:-},{0: }"</span>, inf<span class="br0">)</span><span class="sy4">;</span> <span class="co1">// value of s2 is "inf,+inf,inf, inf"</span>
<span class="kw4">auto</span> s3 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{0:},{0:+},{0:-},{0: }"</span>, nan<span class="br0">)</span><span class="sy4">;</span> <span class="co1">// value of s3 is "nan,+nan,nan, nan"</span></pre></div></div>
<p>The <code><b>#</b></code> option causes the <i>alternate form</i> to be used for the conversion.
</p>
<ul><li> For integral types, when binary, octal, or hexadecimal presentation type is used, the  alternate form inserts the prefix (<code>0b</code>, <code>0</code>, or <code>0x</code>) into the output value after the sign character (possibly space) if there is one, or add it before the output value otherwise.
</li><li> For floating-point types, the alternate form causes the result of the conversion of finite values to always contain a decimal-point character, even if no digits follow it. Normally, a decimal-point character appears in the result of these conversions only if a digit follows it. In addition, for <code><b>g</b></code> and <code><b>G</b></code> conversions, trailing zeros are not removed from the result.
</li></ul>
<p>The <code><b>0</b></code> option pads the field with leading zeros (following any indication of sign or base) to the field width, except when applied to an infinity or NaN. If the <code>0</code> character and an <i>align</i> option both appear, the <code>0</code> character is ignored.
</p>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw4">char</span> c <span class="sy1">=</span> <span class="nu0">120</span><span class="sy4">;</span>
<span class="kw4">auto</span> s1 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:+06d}"</span>, c<span class="br0">)</span><span class="sy4">;</span>   <span class="co1">// value of s1 is "+00120"</span>
<span class="kw4">auto</span> s2 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:#06x}"</span>, <span class="nu12">0xa</span><span class="br0">)</span><span class="sy4">;</span> <span class="co1">// value of s2 is "0x000a"</span>
<span class="kw4">auto</span> s3 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:&lt;06}"</span>, <span class="sy2">-</span><span class="nu0">42</span><span class="br0">)</span><span class="sy4">;</span>  <span class="co1">// value of s3 is "-42   "</span>
                                       <span class="co1">// (0 is ignored because of &lt; alignment)</span></pre></div></div>
<h5><span class="mw-headline" id="width_and_precision">width and precision</span></h5>
<p><span class="t-spar">width</span> is either a positive decimal number, or a nested replacement field (<code><b>{} </b></code> or <code><b>{</b></code><i>n</i><code><b>}</b></code>). If present, it specifies the minimum field width.
</p><p><span class="t-spar">precision</span> is a dot (<code><b>.</b></code>) followed by either a non-negative decimal number or a nested replacement field. This field indicates the precision or maximum field size. It can only be used with floating-point and string types. For floating-point types, this field specifies the formatting precision. For string types, it provides an upper bound for the estimated width (see below) of the prefix of the string to be copied to the output. For a string in a Unicode encoding, the text to be copied to the output is the longest prefix of whole extended grapheme clusters whose estimated width is no greater than the precision.
</p><p>If a nested replacement field is used for <span class="t-spar">width</span> or <span class="t-spar">precision</span>, and the corresponding argument is not of integral type, or is negative, or is zero for <span class="t-spar">width</span>, an exception of type <span class="t-lc"><a href="format_error.html" title="cpp/utility/format/format error">std::format_error</a></span> is thrown.
</p>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw4">float</span> pi <span class="sy1">=</span> <span class="nu17">3.14f</span><span class="sy4">;</span>
<span class="kw4">auto</span> s1 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:10f}"</span>, pi<span class="br0">)</span><span class="sy4">;</span>           <span class="co1">// s1 = "  3.140000" (width = 10)</span>
<span class="kw4">auto</span> s2 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:{}f}"</span>, pi, <span class="nu0">10</span><span class="br0">)</span><span class="sy4">;</span>       <span class="co1">// s2 = "  3.140000" (width = 10)</span>
<span class="kw4">auto</span> s3 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:.5f}"</span>, pi<span class="br0">)</span><span class="sy4">;</span>           <span class="co1">// s3 = "3.14000" (precision = 5)</span>
<span class="kw4">auto</span> s4 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:.{}f}"</span>, pi, <span class="nu0">5</span><span class="br0">)</span><span class="sy4">;</span>       <span class="co1">// s4 = "3.14000" (precision = 5)</span>
<span class="kw4">auto</span> s5 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:10.5f}"</span>, pi<span class="br0">)</span><span class="sy4">;</span>         <span class="co1">// s5 = "   3.14000"</span>
                                               <span class="co1">// (width = 10, precision = 5)</span>
<span class="kw4">auto</span> s6 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:{}.{}f}"</span>, pi, <span class="nu0">10</span>, <span class="nu0">5</span><span class="br0">)</span><span class="sy4">;</span> <span class="co1">// s6 = "   3.14000"</span>
                                               <span class="co1">// (width = 10, precision = 5)</span>
 
<span class="kw4">auto</span> b1 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:{}f}"</span>, pi, <span class="nu16">10.0</span><span class="br0">)</span><span class="sy4">;</span>     <span class="co1">// throws: width is not of integral type </span>
<span class="kw4">auto</span> b2 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:{}f}"</span>, pi, <span class="sy2">-</span><span class="nu0">10</span><span class="br0">)</span><span class="sy4">;</span>      <span class="co1">// throws: width is negative</span>
<span class="kw4">auto</span> b3 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:.{}f}"</span>, pi, <span class="nu16">5.0</span><span class="br0">)</span><span class="sy4">;</span>     <span class="co1">// throws: precision is not of integral type</span></pre></div></div>
<p>For string types, the width is defined as the estimated number of column positions appropriate for displaying it in a terminal.
</p><p>For the purpose of width computation, a string is assumed to be in a implementation-defined encoding. The method of width computation is unspecified, but for a string in a Unicode encoding, implementation should estimate the width of the string as the sum of estimated widths of the first code points in its extended grapheme clusters. The estimated width of a Unicode code point is 2 if the code point is within the following range, or 1 if it isn't:
</p>
<ul><li> U+1100 - U+115F
</li><li> U+2329 - U+232A
</li><li> U+2E80 - U+303E
</li><li> U+3040 - U+A4CF
</li><li> U+AC00 - U+D7A3
</li><li> U+F900 - U+FAFF
</li><li> U+FE10 - U+FE19
</li><li> U+FE30 - U+FE6F
</li><li> U+FF00 - U+FF60
</li><li> U+FFE0 - U+FFE6
</li><li> U+1F300 - U+1F64F
</li><li> U+1F900 - U+1F9FF
</li><li> U+20000 - U+2FFFD
</li><li> U+30000 - U+3FFFD
</li></ul>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw4">auto</span> s1 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:.^5s}"</span>,   <span class="st0">"🐱"</span><span class="br0">)</span><span class="sy4">;</span>      <span class="co1">// s1 = ".🐱.."</span>
<span class="kw4">auto</span> s2 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:.5s}"</span>,    <span class="st0">"🐱🐱🐱"</span><span class="br0">)</span><span class="sy4">;</span>  <span class="co1">// s2 = "🐱🐱"</span>
<span class="kw4">auto</span> s3 <span class="sy1">=</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:.&lt;5.5s}"</span>, <span class="st0">"🐱🐱🐱"</span><span class="br0">)</span><span class="sy4">;</span>  <span class="co1">// s3 = "🐱🐱."</span></pre></div></div>
<h5><span class="mw-headline" id="L_.28locale-specific_formatting.29">L (locale-specific formatting)</span></h5>
<p>The <code><b>L</b></code> option causes the locale-specific form to be used. This option is only valid for arithmetic types.
</p>
<ul><li> For integral types, the locale-specific form inserts the appropriate digit group separator characters according to the context's locale.
</li><li> For floating-point types, the locale-specific form inserts the appropriate digit group and radix separator characters according to the context's locale.
</li><li> For the textual representation of <code>bool</code>, the locale-specific form uses the appropriate string as if obtained with <span class="t-lc"><a href="../../locale/numpunct/truefalsename.html" title="cpp/locale/numpunct/truefalsename">std::numpunct::truename</a></span> or <span class="t-lc"><a href="../../locale/numpunct/truefalsename.html" title="cpp/locale/numpunct/truefalsename">std::numpunct::falsename</a></span>.
</li></ul>
<h5><span class="mw-headline" id="type">type</span></h5>
<p>The <span class="t-spar">type</span> option determines how the data should be presented.
</p><p>The available string presentation types are:
</p>
<ul><li> none, <code><b>s</b></code>: Copies the string to the output.
</li></ul>
<p>The available integer presentation types for integral types other than <code>char</code>, <code>wchar_t</code>, and <code>bool</code> are:
</p>
<ul><li> <code><b>b</b></code>: Binary format. Produces the output as if by calling <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../to_chars.html"><span class="kw2640">std::<span class="me2">to_chars</span></span></a><span class="br0">(</span>first, last, value, <span class="nu0">2</span><span class="br0">)</span></span></span>. The base prefix is <code>0b</code>.
</li><li> <code><b>B</b></code>: same as <code><b>b</b></code>, except that the base prefix is <code>0B</code>.
</li><li> <code><b>c</b></code>: Copies the character <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw1">static_cast</span><span class="sy1">&lt;</span>CharT<span class="sy1">&gt;</span><span class="br0">(</span>value<span class="br0">)</span></span></span> to the output, where <span class="t-c"><span class="mw-geshi cpp source-cpp">CharT</span></span> is the character type of the format string. Throws <span class="t-lc"><a href="format_error.html" title="cpp/utility/format/format error">std::format_error</a></span> if value is not in the range of representable values for <span class="t-c"><span class="mw-geshi cpp source-cpp">CharT</span></span>.
</li><li> <code><b>d</b></code>: Decimal format. Produces the output as if by calling <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../to_chars.html"><span class="kw2640">std::<span class="me2">to_chars</span></span></a><span class="br0">(</span>first, last, value<span class="br0">)</span></span></span>.
</li><li> <code><b>o</b></code>: Octal format. Produces the output as if by calling <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../to_chars.html"><span class="kw2640">std::<span class="me2">to_chars</span></span></a><span class="br0">(</span>first, last, value, <span class="nu0">8</span><span class="br0">)</span></span></span>. The base prefix is <code>0</code> if the corresponding argument value is nonzero and is empty otherwise.
</li><li> <code><b>x</b></code>: Hex format. Produces the output as if by calling <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../to_chars.html"><span class="kw2640">std::<span class="me2">to_chars</span></span></a><span class="br0">(</span>first, last, value, <span class="nu0">16</span><span class="br0">)</span></span></span>. The base prefix is <code>0x</code>.
</li><li> <code><b>X</b></code>: same as <code><b>x</b></code>, except that it uses uppercase letters for digits above 9 and the base prefix is <code>0X</code>.
</li><li> none: same as <code><b>d</b></code>.
</li></ul>
<p>The available <code>char</code> and <code>wchar_t</code> presentation types are:
</p>
<ul><li> none, <code><b>c</b></code>: Copies the character to the output.
</li><li> <code><b>b</b></code>, <code><b>B</b></code>, <code><b>d</b></code>, <code><b>o</b></code>, <code><b>x</b></code>, <code><b>X</b></code>: Uses integer presentation types.
</li></ul>
<p>The available <code>bool</code> presentation types are:
</p>
<ul><li> none, <code><b>s</b></code>: Copies textual representation (<code><b>true</b></code> or <code><b>false</b></code>, or the locale-specific form) to the output.
</li><li> <code><b>b</b></code>, <code><b>B</b></code>, <code><b>c</b></code>, <code><b>d</b></code>, <code><b>o</b></code>, <code><b>x</b></code>, <code><b>X</b></code>: Uses integer presentation types with the value <code>static_cast&lt;unsigned char&gt;(value)</code>.
</li></ul>
<p>The available floating-point presentation types are:
</p>
<ul><li> <code><b>a</b></code>: If <i>precision</i> is specified, produces the output as if by calling <a href="../to_chars.html" title="cpp/utility/to chars"><tt>std::to_chars(first, last, value, std::chars_format::hex, precision)</tt></a> where <code>precision</code> is the specified precision; otherwise, the output is produced as if by calling <a href="../to_chars.html" title="cpp/utility/to chars"><tt>std::to_chars(first, last, value, std::chars_format::hex)</tt></a>.
</li><li> <code><b>A</b></code>: same as <code><b>a</b></code>, except that it uses uppercase letters for digits above 9 and uses <code>P</code> to indicate the exponent.
</li><li> <code><b>e</b></code>: Produces the output as if by calling <a href="../to_chars.html" title="cpp/utility/to chars"><tt>std::to_chars(first, last, value, std::chars_format::scientific, precision)</tt></a> where <code>precision</code> is the specified precision, or 6 if precision is not specified.
</li><li> <code><b>E</b></code>: same as <code><b>e</b></code>, except that it uses <code>E</code> to indicate the exponent.
</li><li> <code><b>f</b></code>, <code><b>F</b></code>: Produces the output as if by calling <a href="../to_chars.html" title="cpp/utility/to chars"><tt>std::to_chars(first, last, value, std::chars_format::fixed, precision)</tt></a> where <code>precision</code> is the specified precision, or 6 if precision is not specified.
</li><li> <code><b>g</b></code>: Produces the output as if by calling <a href="../to_chars.html" title="cpp/utility/to chars"><tt>std::to_chars(first, last, value, std::chars_format::general, precision)</tt></a> where <code>precision</code> is the specified precision, or 6 if precision is not specified.
</li><li> <code><b>G</b></code>: same as <code><b>g</b></code>, except that it uses <code>E</code> to indicate the exponent.
</li><li> none: If <i>precision</i> is specified, produces the output as if by calling <a href="../to_chars.html" title="cpp/utility/to chars"><tt>std::to_chars(first, last, value, std::chars_format::general, precision)</tt></a> where <code>precision</code> is the specified precision; otherwise, the output is produced as if by calling <a href="../to_chars.html" title="cpp/utility/to chars"><tt>std::to_chars(first, last, value)</tt></a>.
</li></ul>
<p>For lower-case presentation types, infinity and NaN are formatted as <code>inf</code> and <code>nan</code>, respectively.
For upper-case presentation types, infinity and NaN are formatted as <code>INF</code> and <code>NAN</code>, respectively.
</p><p>The available pointer presentation types (also used for <code>std::nullptr_t</code>) are:
</p>
<ul><li> none, <code><b>p</b></code>: If <span class="t-lc"><a href="../../types/integer.html" title="cpp/types/integer">std::uintptr_t</a></span> is defined, produces the output as if by calling <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../to_chars.html"><span class="kw2640">std::<span class="me2">to_chars</span></span></a><span class="br0">(</span>first, last, <span class="kw1">reinterpret_cast</span><span class="sy1">&lt;</span><a href="../../types/integer.html"><span class="kw139">std::<span class="me2">uintptr_t</span></span></a><span class="sy1">&gt;</span><span class="br0">(</span>value<span class="br0">)</span>, <span class="nu0">16</span><span class="br0">)</span></span></span> with the prefix <code>0x</code> added to the output; otherwise, the output is implementation-defined.
</li></ul>
<h3><span class="mw-headline" id="Standard_specializations_for_library_types">Standard specializations for library types</span></h3>
<table class="t-dsc-begin">

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/duration/formatter.html" title="cpp/chrono/duration/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::duration&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>duration</code> according to the provided format <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/system_clock/formatter.html" title="cpp/chrono/system clock/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::sys_time&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>sys_time</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/utc_clock/formatter.html" title="cpp/chrono/utc clock/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::utc_time&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>utc_time</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/tai_clock/formatter.html" title="cpp/chrono/tai clock/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::tai_time&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>tai_time</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/gps_clock/formatter.html" title="cpp/chrono/gps clock/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::gps_time&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>gps_time</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/file_clock/formatter.html" title="cpp/chrono/file clock/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::file_time&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>file_time</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/local_t/formatter.html" title="cpp/chrono/local t/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::local_time&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>local_time</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/day/formatter.html" title="cpp/chrono/day/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::day&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>day</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/month/formatter.html" title="cpp/chrono/month/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::month&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>month</code> according to the provided format <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/year/formatter.html" title="cpp/chrono/year/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::year&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>year</code> according to the provided format <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/weekday/formatter.html" title="cpp/chrono/weekday/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::weekday&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>weekday</code> according to the provided format <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/weekday_indexed/formatter.html" title="cpp/chrono/weekday indexed/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::weekday_indexed&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>weekday_indexed</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/weekday_last/formatter.html" title="cpp/chrono/weekday last/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::weekday_last&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>weekday_last</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/month_day/formatter.html" title="cpp/chrono/month day/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::month_day&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>month_day</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/month_day_last/formatter.html" title="cpp/chrono/month day last/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::month_day_last&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>month_day_last</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/month_weekday/formatter.html" title="cpp/chrono/month weekday/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::month_weekday&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>month_weekday</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/month_weekday_last/formatter.html" title="cpp/chrono/month weekday last/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::month_weekday_last&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>month_weekday_last</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/year_month/formatter.html" title="cpp/chrono/year month/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::year_month&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>year_month</code> according to the provided format <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/year_month_day/formatter.html" title="cpp/chrono/year month day/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::year_month_day&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>year_month_day</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/year_month_day_last/formatter.html" title="cpp/chrono/year month day last/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::year_month_day_last&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>year_month_day_last</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/year_month_weekday/formatter.html" title="cpp/chrono/year month weekday/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::year_month_weekday&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>year_month_weekday</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/year_month_weekday_last/formatter.html" title="cpp/chrono/year month weekday last/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::year_month_weekday_last&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>year_month_weekday_last</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/hh_mm_ss/formatter.html" title="cpp/chrono/hh mm ss/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::hh_mm_ss&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>hh_mm_ss</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/sys_info/formatter.html" title="cpp/chrono/sys info/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::sys_info&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>sys_info</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/local_info/formatter.html" title="cpp/chrono/local info/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::local_info&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>local_info</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../chrono/zoned_time/formatter.html" title="cpp/chrono/zoned time/formatter"> <span class="t-lines"><span>std::formatter<span class="t-dsc-small">&lt;std::chrono::zoned_time&gt;</span></span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   specialization of <span class="t-lc"><strong class="selflink">std::formatter</strong></span> that formats a <code>zoned_time</code> according to the provided format  <br> <span class="t-mark">(class template specialization)</span> </td></tr>
</table>
<h3><span class="mw-headline" id="Example">Example</span></h3>
<div class="t-example"><div class="t-example-live-link"><div class="coliru-btn coliru-btn-run-init">Run this code</div></div>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="co2">#include &lt;format&gt;</span>
<span class="co2">#include &lt;iostream&gt;</span>
 
<span class="co1">// A wrapper for type T</span>
<span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
<span class="kw1">struct</span> Box <span class="br0">{</span>
    T value<span class="sy4">;</span>
<span class="br0">}</span><span class="sy4">;</span>
 
<span class="co1">// The wrapper Box&lt;T&gt; can be formatted using the format specification of the wrapped value</span>
<span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T, <span class="kw1">class</span> CharT<span class="sy1">&gt;</span>
<span class="kw1">struct</span> std<span class="sy4">::</span><span class="me2">formatter</span><span class="sy1">&lt;</span>Box<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span>, CharT<span class="sy1">&gt;</span> <span class="sy4">:</span> std<span class="sy4">::</span><span class="me2">formatter</span><span class="sy1">&lt;</span>T, CharT<span class="sy1">&gt;</span> <span class="br0">{</span>
    <span class="co1">// parse() is inherited from the base class</span>
 
    <span class="co1">// Define format() by calling the base class implementation with the wrapped value</span>
    <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> FormatContext<span class="sy1">&gt;</span>
    <span class="kw4">auto</span> format<span class="br0">(</span>Box<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> t, FormatContext<span class="sy3">&amp;</span> fc<span class="br0">)</span> <span class="kw4">const</span> <span class="br0">{</span>
        <span class="kw1">return</span> std<span class="sy4">::</span><span class="me2">formatter</span><span class="sy1">&lt;</span>T, CharT<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">format</span><span class="br0">(</span>t.<span class="me1">value</span>, fc<span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
<span class="br0">}</span><span class="sy4">;</span>
 
<span class="kw4">int</span> main<span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span>
    Box<span class="sy1">&lt;</span><span class="kw4">int</span><span class="sy1">&gt;</span> v <span class="sy1">=</span> <span class="br0">{</span> <span class="nu0">42</span> <span class="br0">}</span><span class="sy4">;</span>
    <a href="../../io/cout.html"><span class="kw1762">std::<span class="me2">cout</span></span></a> <span class="sy1">&lt;&lt;</span> <a href="format.html"><span class="kw3150">std::<span class="me2">format</span></span></a><span class="br0">(</span><span class="st0">"{:#x}"</span>, v<span class="br0">)</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<p>Output:
</p>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="text source-text"><pre class="de1">0x2a</pre></div></div> 
</div>
<h3><span class="mw-headline" id="See_also">See also</span></h3>
<table class="t-dsc-begin">

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="basic_format_context.html" title="cpp/utility/format/basic format context"> <span class="t-lines"><span>basic_format_context</span><span>format_context</span><span>wformat_context</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   formatting state, including all formatting arguments and the output iterator  <br> <span class="t-mark">(class template)</span> </td></tr>
</table>

<!-- 
NewPP limit report
Preprocessor visited node count: 11402/1000000
Preprocessor generated node count: 16040/1000000
Post‐expand include size: 417068/2097152 bytes
Template argument size: 98651/2097152 bytes
Highest expansion depth: 23/40
Expensive parser function count: 0/100
-->

<!-- Saved in parser cache with key mwiki1-mwiki_en_:pcache:idhash:18708-0!*!0!!en!*!* and timestamp 20220728105650 -->
</div>                    <!-- /bodycontent -->
                                        <!-- printfooter -->
                    <div class="printfooter">
                    Retrieved from "<a href="https://en.cppreference.com/mwiki/index.php?title=cpp/utility/format/formatter&amp;oldid=141498">https://en.cppreference.com/mwiki/index.php?title=cpp/utility/format/formatter&amp;oldid=141498</a>"                    </div>
                    <!-- /printfooter -->
                                                            <!-- catlinks -->
                    <!-- /catlinks -->
                                                            <div class="visualClear"></div>
                    <!-- debughtml -->
                                        <!-- /debughtml -->
                </div>
                <!-- /bodyContent -->
            </div>
        </div>
        <!-- /content -->
        <!-- footer -->
        <div id="cpp-footer-base" class="noprint">
            <div id="footer">
                        <div id="cpp-navigation">
            <h5>Navigation</h5>
            <ul><li><a href="https://en.cppreference.com/w/cpp/utility/format/formatter">Online version</a></li><li>Offline version retrieved 2022-07-30 14:05.</li></ul></div>
                        <ul id="footer-info">
                                    <li id="footer-info-lastmod"> This page was last modified on 28 July 2022, at 03:56.</li>
                                    <li id="footer-info-viewcount">This page has been accessed 69,243 times.</li>
                            </ul>
                    </div>
        </div>
        <!-- /footer -->
        <script>if(window.mw){
mw.loader.state({"site":"loading","user":"missing","user.groups":"ready"});
}</script>
<script src="../../../../common/skin_scripts.js"></script>
<script>if(window.mw){
mw.loader.load(["mediawiki.action.view.postEdit","mediawiki.user","mediawiki.page.ready","mediawiki.searchSuggest","mediawiki.hidpi","ext.gadget.ColiruCompiler","ext.gadget.MathJax"], null, true);
}</script>
<script src="../../../../common/site_scripts.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2828341-1']);
_gaq.push(['_setDomainName', 'cppreference.com']);
_gaq.push(['_trackPageview']);
</script><!-- Served in 0.036 secs. -->
	</body>
<!-- Cached 20220728110622 -->
</html>